package com.example.randomscrollmaptile;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {
	
	private GameView gameView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		gameView = new GameView(this);
		setContentView(gameView);
		//setContentView(R.layout.activity_main);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		gameView.onResume();
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		gameView.onPause();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	public boolean onOptionsItemSelected(MenuItem item) {
		switch(item.getItemId()) {
		case R.id.frame60:
			Engine.GAME_THREAD_FPS_SLEEP = (1000/60);
			return true;
		
		case R.id.frame30:
			Engine.GAME_THREAD_FPS_SLEEP = (1000/30);
			return true;
		
		case R.id.frame10:
			Engine.GAME_THREAD_FPS_SLEEP = (1000/10);
			return true;
		}
		return false;
	}

}
